import { http } from '@/utils/http';
import { Feature } from '@/service/types/feature';
import { User } from './types/user';

/** 获取充值套餐配置 */
export const GetRechargePackageInfoList = (data) => {
  return http.post<Feature.RechargePackageInfoItem[]>('/recharge-package-info/list', data)
}

/** 充值 */
export const UserBalanceInfoAddAmount = (data) => {
  return http.post<Feature.Payment>('/user-balance-info/addAmount', data)
}

/** 打赏 */
export const UserBalanceInfoReward = (data) => {
  return http.post<any>('/user-balance-info/reward', data)
}

/** 消费乐缘币 */
export const UserBalanceInfoReduceAmount = (data) => {
  return http.post<any>('/user-balance-info/reduceAmount', data)
}

/** 获取充值记录表分页 */
export const UserRechargeRecordInfoPage = (query: {
  userId: string;
}, data) => {
  return http.post<IResDataInfo<Feature.UserRechargeRecordInfoPage>>('/user-recharge-record-info/page', query, data)
}

/** 获取用户乐缘币 */
export const GetQueryBalance = (data: {
  userId: string;
}) => {
  return http.get<Feature.QueryBalanceRes>('/user-balance-info/queryBalance', data)
}

/** 获取会员配置表列表 */
export const GetMemberList = (data) => {
  return http.post<Feature.MemberListItem[]>('/membership-configuration/memberList', data)
}

/** 办理会员 */
export const UserMembershipInfoMembership = (data: {
  userId: String;
  membershipId: String;
}) => {
  return http.post<any>('/user-membership-info/membership', data)
}

/** 新增用户问题反馈 */
export const UserFeedbackInfo = (data: {
  userId: String;
  description: String;
}) => {
  return http.post<any>('/user-feedback-info', data)
}

/** 用户置顶配置 */
export const UserTopConfigInfoTop = (data: {
  userId: String;
  durationDays: number;
  paymentAmount: number;
}) => {
  return http.post<any>('/user-top-config-info/top', data)
}

/** 获取红娘分页 */
export const GetMatchmakerInfoPage = (query, data) => {
  return http.post<IResDataInfo<any>>('/matchmaker-info/page', query, data)
}

/** 根据用户id获取红娘详情 */
export const GetQueryByUserId = (data) => {
  return http.get<User.MatchmakerInfo>('/matchmaker-info/queryByUserId', data)
}

/** 添加红娘信息 */
export const AddInfo = (data) => {
  return http.post<any>('/matchmaker-info/addInfo', data)
}

/** 提现列表 */
export const GetUserCommissionWithdrawalHistory = (data) => {
  return http.post<any>('/user-commission-withdrawal-history/list', data)
}

/** 获取邀请列表 */
export const GetInviteList = (data) => {
  return http.post<any>('/user-info/inviteList', data)
}

/** 获取邀请明细 */
export const GetInviteDetail = (data) => {
  return http.post<any>('/user-info/invite_detail', data)
}

/** 获取用户回佣乐缘币 */
export const GetUserCommissionBalance = (data) => {
  return http.get<any>('/user-commission-balance/queryByUserId', data)
}

/** 提现 */
export const WithdrawalCommission = (data) => {
  return http.get<any>('/user-commission-balance/withdrawalCommission', data)
}

/** 商户转账到微信余额（前端） */
export const WithdrawMoneyToWeChat = (data) => {
  return http.post<any>('/wechat/withdrawMoneyToWeChat', data)
}

/** 取消微信提现 */
export const CancelWithdrawToWeChat = (data) => {
  return http.get<any>('/wechat/cancelWithdrawToWeChat', data)
}

/** 根据id获取线下服务商表详情(前端) */
export const OfflineServiceProviderQueryByUserId = (data: { userId: string; type: string }) => {
  return http.get<any>('/offline-service-provider/queryByUserId', data)
}

/** 添加线下服务商(前端) */
export const AddOfflineServiceProviderInfo = (data: Feature.AddOfflineServiceProviderInfoData) => {
  return http.post<any>('/offline-service-provider/addInfo', data)
}

/** 获取用户消费记录表分页 */
export const GetUserTransactionInfo = (params, data: any) => {
  return http.post<IResDataInfo<Feature.ConsumeItem>>('/user-transaction-info/page', params, data)
}

/** 获取合伙人类别配置列表 */
export const GetPartnerCategoryConfigList = (data: any) => {
  return http.post<Feature.PartnerCategoryConfigItem[]>('/partner-category-config/list', data)
}